﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;

namespace Hsinchu.Utility
{
    /*
     * 安全处理类
     */
    public  class SecurityHandle
    {
        /// <summary>
        /// MD5加密字符串
        /// </summary>
        /// <param name="strUnencrypted">未加密字符串</param>
        /// <returns>string</returns>
        public static string EncryptMD5(string strUnencrypted)
        {
            strUnencrypted = FormsAuthentication.HashPasswordForStoringInConfigFile(strUnencrypted, "MD5");
            return strUnencrypted;
        }

        /// <summary>
        /// SHA1加密字符串
        /// </summary>
        /// <param name="strUnencrypted">未加密字符串</param>
        /// <returns>string</returns>
        public static string EncryptSHA(string strUnencrypted)
        {
            strUnencrypted = FormsAuthentication.HashPasswordForStoringInConfigFile(strUnencrypted, "SHA1");
            return strUnencrypted;
        }
    }
}
